# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $


DESCRIPTION="A small library implementing an HTTP 1.1 web server"
HOMEPAGE="http://gnunet.org/libmicrohttpd/"
SRC_URI="http://gnunet.org/libmicrohttpd/download/${P}.tar.gz"


KEYWORDS="~amd64 ~x86"
LICENSE="LGPL-2.1"
SLOT="0"
IUSE="examples test advtest"

DEPEND="test? (
			advtest? (
				net-misc/socat
				app-forensics/zzuf
			)
			net-misc/curl
		)"

src_unpack() {
	unpack ${A}
	cd "${S}"
}

src_compile() {
	econf || die "econf failed"
	emake || die "emake failed"
}

src_test() {
		emake check || die "some test failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc AUTHORS ChangeLog NEWS README
	
	if use examples; then
		insinto /usr/share/doc/${PF}/examples
		doins src/examples/*.c
	fi

}

